package com.hxkj.service;

import com.hxkj.domain.po.SysUser;
import com.hxkj.domain.po.LoginToken;
import com.platform.common.domain.result.ResultDataStruct;
import com.platform.common.domain.result.ResultMessageStruct;

/**
 * created by kezhijie on 2018/8/21 9:35.
 * email to kezhijie@hxoss.com
 */
public interface UserService {

    /**
     * 保存用户注册信息
     * @param sysUser
     * @return
     */
    ResultMessageStruct save(SysUser sysUser) throws Exception ;

    /**
     * 登录
     * @param sysUser
     * @return
     * @throws Exception
     */
    ResultDataStruct<LoginToken> login(SysUser sysUser) throws Exception ;

    /**
     * 根据实体条件查找用户
     * @param condition
     * @return
     * @throws Exception
     */
    SysUser existsUser(SysUser condition) throws Exception ;

    /**
     * 修改用户信息，除电话密码外
     * @return
     * @throws Exception
     */
    ResultDataStruct<SysUser> update(SysUser sysUser) throws Exception;

    /**
     * 修改密码
     * @param sysUser
     * @return
     * @throws Exception
     */
    ResultMessageStruct updatePassword(SysUser sysUser) throws Exception;

    /**
     * 修改电话
     * @param sysUser
     * @return
     * @throws Exception
     */
    ResultMessageStruct updatePhone(SysUser sysUser) throws Exception;

    /**
     * 根据userId查找用户信息
     * @param userId
     * @return
     * @throws Exception
     */
    SysUser findByUserId(String userId) throws Exception;
}
